import threading
import time
from terminal import *
from myCamera import *
from faceOperate import faceOperate
import json

# import time
# from mySocket import *
# from Config import getConfig


class myThread(threading.Thread):

    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
        pass


if __name__ == "__main__":
    socket = mySocket(getConfig('client.config', 'socket', 'host'), int(getConfig('client.config', 'socket', 'port')))
    terminal()
    cam = camera()
    # print(faceOperate.addFace(socket, cam, '202111060227'))
    while True:
        print("-----------菜单----------")
        print("--------1.开始记录------------")
        print("--------2.扫描人脸------------")
        # print("----------3.退出-------------")
        menu = input("请输入:")
        if menu == '1':
            faceOperate.SearchFace(socket, cam)


        elif menu == '2':
            print("-----------菜单----------")
            stuid = input("请输入学号:")
            print(faceOperate.addFace(socket, cam, stuid))

